Ciao
Ho creato un pulsante per poter lanciare un eseguibile e leggerne il suo output:
private void button5_Click(object sender, EventArgs e)
{
ProcessStartInfo start = new ProcessStartInfo();
start.FileName = "C:\\Program Files\\MediaInfo_CLI\\MediaInfo.exe" + "--help";
//MessageBox.Show(openFileDialog1.FileName);
start.UseShellExecute = false;
start.RedirectStandardOutput = true;
using (Process process = Process.Start(start))
{
using (StreamReader reader = process.StandardOutput)
{
string result = reader.ReadToEnd();
MessageBox.Show (result);
}
}
Purtroppo si ferma sul Process.Start(start)) dandomi:
Win32Exception non è gestita.
Non riesco a trovare la soluzione.
Grazie anticipatamente.
|